Integrand size = 40, antiderivative size = 90 \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx=-\frac {(b B-a C) x}{a^2}+\frac {2 b (b B-a C) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b} d}+\frac {B \sin (c+d x)}{a d} \]
[Out]
Time = 0.27 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {4157, 4119, 12, 3868, 2738, 214} \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx=\frac {2 b (b B-a C) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d \sqrt {a-b} \sqrt {a+b}}-\frac {x (b B-a C)}{a^2}+\frac {B \sin (c+d x)}{a d} \]
[In]
[Out]
Rule 12
Rule 214
Rule 2738
Rule 3868
Rule 4119
Rule 4157
Rubi steps \begin{align*} \text {integral}& = \int \frac {\cos (c+d x) (B+C \sec (c+d x))}{a+b \sec (c+d x)} \, dx \\ & = \frac {B \sin (c+d x)}{a d}-\frac {\int \frac {b B-a C}{a+b \sec (c+d x)} \, dx}{a} \\ & = \frac {B \sin (c+d x)}{a d}-\frac {(b B-a C) \int \frac {1}{a+b \sec (c+d x)} \, dx}{a} \\ & = -\frac {(b B-a C) x}{a^2}+\frac {B \sin (c+d x)}{a d}+\frac {(b B-a C) \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{a^2} \\ & = -\frac {(b B-a C) x}{a^2}+\frac {B \sin (c+d x)}{a d}+\frac {(2 (b B-a C)) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^2 d} \\ & = -\frac {(b B-a C) x}{a^2}+\frac {2 b (b B-a C) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b} d}+\frac {B \sin (c+d x)}{a d} \\ \end{align*}
Time = 0.63 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.94 \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx=\frac {(-b B+a C) (c+d x)-\frac {2 b (b B-a C) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+a B \sin (c+d x)}{a^2 d} \]
[In]
[Out]
Time = 0.31 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.23
method | result | size |
derivativedivides | \(\frac {\frac {2 b \left (B b -C a \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {2 \left (-\frac {B a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\left (B b -C a \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{a^{2}}}{d}\) | \(111\) |
default | \(\frac {\frac {2 b \left (B b -C a \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {2 \left (-\frac {B a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\left (B b -C a \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{a^{2}}}{d}\) | \(111\) |
risch | \(-\frac {x B b}{a^{2}}+\frac {x C}{a}-\frac {i B \,{\mathrm e}^{i \left (d x +c \right )}}{2 a d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B}{2 a d}+\frac {b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) B}{\sqrt {a^{2}-b^{2}}\, d \,a^{2}}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) C}{\sqrt {a^{2}-b^{2}}\, d a}-\frac {b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) B}{\sqrt {a^{2}-b^{2}}\, d \,a^{2}}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) C}{\sqrt {a^{2}-b^{2}}\, d a}\) | \(352\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 328, normalized size of antiderivative = 3.64 \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx=\left [\frac {2 \, {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} d x - {\left (C a b - B b^{2}\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) + 2 \, {\left (B a^{3} - B a b^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{4} - a^{2} b^{2}\right )} d}, \frac {{\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} d x - {\left (C a b - B b^{2}\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) + {\left (B a^{3} - B a b^{2}\right )} \sin \left (d x + c\right )}{{\left (a^{4} - a^{2} b^{2}\right )} d}\right ] \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx=\int \frac {\left (B + C \sec {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.32 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.57 \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx=\frac {\frac {{\left (C a - B b\right )} {\left (d x + c\right )}}{a^{2}} + \frac {2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} a} - \frac {2 \, {\left (C a b - B b^{2}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{\sqrt {-a^{2} + b^{2}} a^{2}}}{d} \]
[In]
[Out]
Time = 19.32 (sec) , antiderivative size = 740, normalized size of antiderivative = 8.22 \[ \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx=\frac {2\,B\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (a^4-a^2\,b^2\right )}+\frac {2\,C\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (a^4-a^2\,b^2\right )}+\frac {B\,a^3\,\sin \left (c+d\,x\right )}{d\,\left (a^4-a^2\,b^2\right )}-\frac {B\,a\,b^2\,\sin \left (c+d\,x\right )}{d\,\left (a^4-a^2\,b^2\right )}+\frac {B\,b^2\,\mathrm {atan}\left (\frac {-a^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a^2-b^2\right )}^{3/2}\,2{}\mathrm {i}+b^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,2{}\mathrm {i}-a^2\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,3{}\mathrm {i}+a^3\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+a^4\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^6-2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b^2+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^4}\right )\,\sqrt {a^2-b^2}\,2{}\mathrm {i}}{d\,\left (a^4-a^2\,b^2\right )}-\frac {2\,B\,a^2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (a^4-a^2\,b^2\right )}-\frac {2\,C\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (a^4-a^2\,b^2\right )}-\frac {C\,a\,b\,\mathrm {atan}\left (\frac {-a^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a^2-b^2\right )}^{3/2}\,2{}\mathrm {i}+b^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,2{}\mathrm {i}-a^2\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,3{}\mathrm {i}+a^3\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+a^4\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^6-2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b^2+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^4}\right )\,\sqrt {a^2-b^2}\,2{}\mathrm {i}}{d\,\left (a^4-a^2\,b^2\right )} \]
[In]
[Out]